﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Balder.Core;

namespace Studio
{
    public partial class Scene2DUserControl : UserControl
    {
        static public List<WayPoint> WayPointsList{ set; get;}
        private WayPoint w;
        private bool count;
        public Scene2DUserControl()
        {
            InitializeComponent();
            WayPointsList = new List<WayPoint>();
            w = new WayPoint();
            count = false;
            this.MouseLeftButtonDown += new MouseButtonEventHandler(Scene2DUserControl_MouseLeftButtonDown);
        }

        void Scene2DUserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Point P = e.GetPosition(Scene2D);
            if (!count)
            {
                w.pointA = P;
                count = true;
            }
            else
            {
                w.pointB = P;
                w.link = WayPointLink.walking;
                WayPointsList.Add(w);
                w = new WayPoint();
                count = false;
            }
        }

        private void Confirm_Click(object sender, RoutedEventArgs e)
        {
                                    //code bta3 calling el service
        }
    }
}
